From 92d4a8cf459ea72bf0c8300dc6f3a897f0d62633 Mon Sep 17 00:00:00 2001 From: Gianni Tedesco Date: Thu, 14 Oct 2010 12:46:29 +0100 Subject: [PATCH] pyxl: fix build of python xl binding for python < 2.5 The python C API introduced Py_ssize_t in version 2.5. Prior to this int's were used instead. Fix the build by way of a heinous preprocessor macro. Signed-off-by: Gianni Tedesco Signed-off-by: Stefano Stabellini committer: Stefano Stabellini --- tools/python/xen/lowlevel/xl/xl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/python/xen/lowlevel/xl/xl.c b/tools/python/xen/lowlevel/xl/xl.c index 6ac2cc42ff..7ab66f4f52 100644 --- a/tools/python/xen/lowlevel/xl/xl.c +++ b/tools/python/xen/lowlevel/xl/xl.c @@ -51,6 +51,10 @@ #define CLS "ctx" +#if PY_MAJOR_VERSION < 2 || (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 5) +#define Py_ssize_t int +#endif + static PyObject *xl_error_obj; int genwrap__obj_init(PyObject *self, PyObject *args, PyObject *kwds) -- 2.30.2